<template>
  <div class='news-list'>
    <ListUnit v-for="(item, index) in listData" :info="item" :key="index" />
  </div>
</template>
<script>
import ListUnit from './unit.vue'
export default {
  components: {ListUnit},
   // props:["type"],
  name: "",
  data() {
    return {
      activeName:"1",
      listData:[
        {},{}
      ]
    };
  },
  methods: {
    changeNews(item){
      this.$set(this,"activeName",item.value)
    },
    init(){
       let type = this.activeName
      _g.apiPost('protalHome/informationList.do',{currPageNo:1,pageSize:10,type:type}).then(res=>{
            if(res.status == 0){
                this.$set(this,"listData",res.data.list)
            }else{

            }
          }
      )

    },
  },

  created() {
    this.$nextTick(()=>{
        let type = this.$router.history.current.query.id
        this.$set(this,'activeName',type)
      this.init(type)

    })
  }
};
</script>
<style lang="scss" scoped>
.news-list {
  width: 1200px;
  margin: 0px auto;
}
</style>